package com.quzitech.efest.activitys.welcome;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

import com.quzitech.efest.R;
import com.quzitech.efest.activitys.base.BaseActivity;
import com.quzitech.efest.activitys.main.MainActivity;
import com.tencent.bugly.crashreport.CrashReport;

public class SplashActivity extends BaseActivity {

	private static final int GO_HOME = 1000;
	private static final int GO_GUIDE = 1001;

	private static final long SPLASH_DELAY_MILLIS = 1500;

	private final static int LOGIN_SUC = 1;
	private final static int LOGIN_FAIL = 2;
	private final static int COOKIE_TIMEOUT = 5;
	private Handler handler;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		handler = new Handler() {
			public void handleMessage(Message msg) {
				switch (msg.what) {

				case GO_HOME:
					goHome();
					// finish();
					// CrashReport.testJavaCrash();
					break;

				}
			}

		};
		init();
	}

	@Override
	protected int getlayout() {
		return R.layout.layout_splash;
	}

	@Override
	protected void initData() {

	}

	private void init() {
		handler.sendEmptyMessageDelayed(GO_HOME, SPLASH_DELAY_MILLIS);

	}

	// private void goGuide() {
	// // TODO Auto-generated method stub
	// nextActivity(GuideActivity.class);
	// }

	private void goHome() {
		// SharedPreferences sp = getApplicationContext().getSharedPreferences(
		// "User", Context.MODE_PRIVATE);
		nextActivity(MainActivity.class);

	}

}
